import Vue from "vue";
import VueRouter from "vue-router";
//import Main from '@/views/Main'
//// 集市 首页
//import MarketIndex from '@/views/market/index'
//// Im 系统
//import ImSeller from '@/views/market/im/seller'   // （im买家沟通页面）
//import ImBuyer from '@/views/market/im/buyer'   // （im卖家沟通页面）
//
//
//// 订单系统
//import Buy from '@/views/market/order/buy/buy' // 付款页面
//import BuyAddress from '@/views/market/order/buy/address'
//import BuyAddressAdd from '@/views/market/order/buy/add'
//import BuyAddressEdit from '@/views/market/order/buy/edit'
//import evaluate from '@/views/market/order/status/evaluate' // 订单评价页面
//import lookEvaluate from '@/views/market/order/status/lookEvaluate' // 查看订单评价
//import appendEvaluate from '@/views/market/order/status/appendEvaluate' // 查看订单评价
//
////=详情=
//import orderDetail from '@/views/market/order/status/detail' 
////=退款=
//import refundApply from '@/views/market/order/refund/apply' 
//import refundDetail from '@/views/market/order/refund/detail' 
//import refundSuccess from '@/views/market/order/refund/success'
//
//
//// 我买到的订单列表
//import reachBuy from '@/views/market/order/manager/reachBuy' 
//import releaseBuy from '@/views/market/order/manager/releaseBuy' 
//import sellOut from '@/views/market/order/manager/sellOut' 
//
//
//// 商品系统
//import Release from '@/views/market/tabbar/release' // 商品发布页
//import editRelease from '@/views/market/goods/editRelease' // 编辑发布的商品
//import GoodsDetail from '@/views/market/goods/detail' // 商品详情页 
//import preview from '@/views/market/goods/preview' // 商品预览页 
//import Snapshot from '@/views/market/goods/snapshot' // 商品详情页 
//import SearchIndex from '@/views/market/goods/search/index'  // 商品搜索页
//import releaseAgain from '@/views/market/goods/releaseAgain'  // 重新发布页面
//
//// 消息系统
//import msgIndex from '@/views/market/msg/index'
//import msgActivity from '@/views/market/msg/activity'
//import msgNotice from '@/views/market/msg/notice'
//import msgInteraction from '@/views/market/msg/interaction'
//
//// 个人中心系统
//import centerIndex from '@/views/market/center/index'
////=设置=
//import setIndex from '@/views/market/center/set/index'
//import addressIndex from '@/views/market/center/set/address/index'
//import addressAdd from '@/views/market/center/set/address/add'
//import addressEdit from '@/views/market/center/set/address/edit'
//import myInfo from '@/views/market/center/myInfo'  // 我的资料
//import homePage from '@/views/market/center/homePage'  // 个人主页
//import mySellOut from '@/views/market/center/mySellOut'  // 我卖出的
//
//
//// 列表系统
//import offBaby from '@/views/market/list/offBaby'   // 下架宝贝列表
//import soldOut from '@/views/market/list/soldOut'
//import myCollection from '@/views/market/list/myCollection' // 收藏列表
//import Browsed from '@/views/market/list/Browsed'   // 浏览列表
//import myRelease from '@/views/market/list/myRelease'  // 我发布的
Vue.use(VueRouter);
const routes = [
    // 外部重定向 只要不存在于其他主路径 都返回主页
    {
    	path: "*",
    	redirect:'/'
    },
    {
	    path: "/",
	    name: "index",
	    component: resolve=>require(['@/views/market/index'],resolve),
	    meta:{
	      keepAlive:true
	    }	    	
    },
    {
	    path: "/product",
	    name: "product",
	    component: resolve=>require(['@/views/market/product'],resolve),
	    meta:{
	      keepAlive:true
	    }	    	
    },    
    {
	    path: "/news",
	    name: "news",
	    component: resolve=>require(['@/views/market/news'],resolve),
	    meta:{
	      keepAlive:true
	    }	    	
    },
    
    {
	    path: "/about",
	    name: "about",
	    component: resolve=>require(['@/views/market/about'],resolve),
	    meta:{
	      keepAlive:true
	    }	    	
    }
  
];

const router = new VueRouter({
	mode:'history',
    routes,
	scrollBehavior (to, from, savedPosition) {		
	    return { x: 0, y: 0 }
	}
});

export default router;
